package com.zdgcc.site.util;

import java.util.Random;

import com.zdgcc.site.db.EchannelDateFormat;

public class CreateImgName {

	public String createImgPrefix() {
		String formatString = "yyyyMMddHHmmssSSS";
		String zz = EchannelDateFormat.getCurrentDateTime(formatString);

		Random random = new Random(System.currentTimeMillis());
		String rand = "" + Math.abs(random.nextInt());
		if (rand.length() == 1) {
			rand = "0" + rand;
		} else {
			rand = rand.substring(0, 2);
		}
		return zz + rand;
	}

	public String createImgName(String suffix) {
		return createImgPrefix() + suffix;
	}
}
